{#include file="top.php"#}
<script type="text/javascript">
    var currentindex=1;
    function changeflash(i) {
        currentindex=i;
        for (j=1;j<=3;j++){//此处的3代表你想要添加的幻灯片的数量与下面的3相呼应
            if (j==i){
                $("#flash"+j).fadeIn('slow');
                $("#flash"+j).show();
                $("#f"+j).removeClass();
                $("#f"+j).addClass("curr");
                /*if(i==1){
                    $("[s=1]").hide();
                    $("#ss1_2").fadeIn('slow');
                    $("[s=2]").hide();
                    $("#ss2_3").fadeIn('slow');
                }else if(i==2){
                    $("[s=1]").hide();
                    $("#ss1_3").fadeIn('slow');
                    $("[s=2]").hide();
                    $("#ss2_1").fadeIn('slow');
                }else{
                    $("[s=1]").hide();
                    $("#ss1_1").fadeIn('slow');
                    $("[s=2]").hide();
                    $("#ss2_2").fadeIn('slow');
                }*/
            }
            else{
                $("#flash"+j).hide();
                $("#f"+j).removeClass();
            }
        }
    }

    function startAm(){
        timerID = setInterval("timer_tick()",3000);//间隔时间设置
    }

    function stopAm(){
        clearInterval(timerID);
    }

    function timer_tick() {
        currentindex=currentindex>=3?1:currentindex+1;//此处的3代表幻灯片循环遍历的次数
        changeflash(currentindex);
    }

    /* *	function ss_over(t){
                $("#show_alt").html(t.alt);
                $("#show_alt").animate({height:"40px"});
        }
        function ss_out(t){
                $("#show_alt").animate({height:"0px"});
        } */

</script>
<div class="body index">
    <div class="main">
        <div class="main_area">
            {#show_block('b18',0,'','main_search_box')#}
            <div class="slideshow" onmouseover='stopAm();' onmouseout='startAm();'>
                <div class="ss_images">
                    <ul style="width:1980px;">
                        {#foreach  from=$flash item=v key=k#}
                        <li id="flash{#$k+1#}">
                            <div class="img_box"><p class="img_p"><a target="_blank" href="{#$v.url#}"><span><img src="{#$v.photo_image2#}" alt="{#$v.alt#}"></span></a></p></div>
                        </li>
                        {#/foreach#}
                        <!-- <div id='show_alt'></div> -->
                        <script>$("#flash a:first").show();startAm();</script>
                    </ul>
                </div>
                <div class="ss_num">
                    <a class="curr" id="f1" onmouseover="changeflash(1)">1</a>
                    <a class="no" id="f2" onmouseover="changeflash(2)">2</a>
                    <a class="no" id="f3" onmouseover="changeflash(3)">3</a>
                </div>
                <!-- <div class="ss_img">
                        {#foreach  from=$flash item=v key=k#}
                        <div><a s=1 id="ss1_{#$k+1#}" {#if $k neq 1#}style="display:none"{#/if#}  href="{#$v.url#}" target='_blank'> <img src="{#$v['photo_image1']#}" alt="" /> </a></div>
                        {#/foreach#}

                        {#foreach  from=$flash item=v key=k#}
                        <div><a s=2 id="ss2_{#$k+1#}" {#if $k neq 2#}style="display:none"{#/if#} href="{#$v.url#}" target='_blank'> <img src="{#$v['photo_image1']#}" alt="" /> </a></div>
                        {#/foreach#}
                </div> -->
            </div>
        </div>
        <div class="invite_box b_box">
            <div class="hd">
                <h2 class="hd_title">邀請</h2>
            </div>
            <div class="bd">
                <ul class="invite_list v_list">

                    {#foreach  from=$invite_new_list item=v key=k#}{#if $k<7#}
                    <li {#if $k eq 0#}class="first"{#else if $k neq 1 && $k neq 2#}class="b_list {#if $k eq 6#}last{#/if#}"{#/if#} {#if $k eq 2#}class="last"{#/if#}>
                        {#if $v.member_type==5#}<h3 class="y_title">尊業體驗團</h3>{#else#}<h3 class="g_title">試用專區</h3>{#/if#}
                        <div class="dashed_r">
                            <div class="img_box" onmouseover="$('#imgalt1_'+{#$k#}).show();" onmouseout="$('#imgalt1_'+{#$k#}).hide();">
                                <p class="img_p">{#if time() > strtotime($v.report_endtime)#}
                                    <a  href="{#if $v.member_type eq 5#}{#optimize_url('product', 'detail', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'detail', 'mtype=1&pid='|cat:$v.id)#}{#/if#}">
                                        {#else#}
                                        <a  href="{#if $v.member_type eq 5#}{#optimize_url('product', 'invite_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'invite_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}">
                                            {#/if#}
                                            <span><img src="{#$v._photo_url#}" alt="{#$v.cname#}" /></span></a>
                                </p>
                                <div class="cover {#if $v.member_type==5#}y_cover{#/if#}" id="imgalt1_{#$k#}" style='display:none' >
                                    <span class="sp_quota">名額 {#$v.quota#}</span>
                                    {#if !empty($v.apply_num) && time()>=strtotime($v.apply_starttime)#}<span class="sp_apply">申請人數 {#$v.apply_num#}</span>{#if $k neq 0#}<br/>{#/if#}{#/if#}
                                    <span class="sp_hot">人氣 {#$v.click#}</span>
                                </div>
                            </div>

                            {#if time() > strtotime($v.report_endtime)#}
                            <h4 class="product_brand"><a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'detail', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'detail', 'mtype=1&pid='|cat:$v.id)#}{#/if#}"  class="product_brand">{#$v.type_name#}</a></h4>
                            <p class="product_title"><a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'detail', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'detail', 'mtype=1&pid='|cat:$v.id)#}{#/if#}">
                                    {#else#}
                                    <h4 class="product_brand"><a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'invite_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'invite_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}"  class="product_brand">{#$v.type_name#}</a></h4>
                                    <p class="product_title"><a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'invite_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'invite_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}">
                                            {#/if#}
                                            {#$v.name#}
                                            <br>
                                            {#$v.cname#}</a>
                                    </p>
                                    {#if time() > strtotime($v.report_endtime)#}
                                    <a class="btn_s seereport" href="{#if $v.member_type eq 5#}{#optimize_url('product', 'detail', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'detail', 'mtype=1&pid='|cat:$v.id)#}{#/if#}"><strong></strong></a>
                                    <span class="rest_time  rest_time_over"></span>
                                    {#else#}
                                    <a class="btn_s btn_s_apply" href="{#if $v.member_type eq 5#}{#optimize_url('product', 'invite_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'invite_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}"><strong></strong></a>
                                    {#if !empty($v._difTime)#}
                                    <span class="rest_time  {#if $v._difTime.1==1#}rest_time_d {#else if $v._difTime.1==3#} rest_time_m{#/if#}">{#$v._difTime.0#}</span>
                                    {#else#}
                                    <span class="rest_time rest_time_cs"></span>
                                    {#/if#}
                                    {#/if#}
                        </div>
                    </li>
                    {#/if#}{#/foreach#}
                </ul>
            </div>
            <div class="ft more_box">
                <ul class="more_list">
                    <li>
                        <a class="more" href="{#optimize_url('product', 'invite_list', 'mtype=5')#}">更多體驗邀請</a>
                    </li>
                    <li>
                        <a class="more" href="{#optimize_url('product', 'invite_list', 'mtype=1')#}">更多試用邀請</a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="report_box_2">
            <div class="lastest_r_box b_box">
                <div class="hd">
                    <h2 class="hd_title"></h2>
                </div>
                <div class="bd">
                    <ul class="lastest_r_list  v_list">
                        {#foreach  from=$new_report_list item=v key=k#}
                        <li>
                            {#if $v.member_type==5#}<h3 class="y_title">尊業體驗團</h3>{#else#}<h3 class="g_title">試用專區</h3>{#/if#}
                            <div class="img_box" onmouseover="$('#imgalt2_'+{#$k#}).show();" onmouseout="$('#imgalt2_'+{#$k#}).hide();">
                                <p class="img_p"><a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'detail', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'detail', 'mtype=1&pid='|cat:$v.id)#}{#/if#}"><span> <img src="{#$v._photo_url#}" alt="{#$v._photo_url#}" /></span></a></p>
                                <div id="imgalt2_{#$k#}" class="cover {#if $v.member_type==5#}y_cover{#/if#}" style='display:none;width:135px;' >
                                    <span class="sp_quota">名額 {#$v.quota#}</span>
                                    <span class="sp_apply">申請人數 {#$v.apply_num#}</span><br/>
                                    <span class="sp_hot">人氣 {#$v.click#}</span>
                                </div>
                            </div>
                            <h4 class="product_brand"><a class="product_brand" href="{#if $v.member_type eq 5#}{#optimize_url('product', 'detail', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'detail', 'mtype=1&pid='|cat:$v.id)#}{#/if#}">{#$v.type_name#}</a></h4>
                            <p class="product_title">
                                <a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'detail', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'detail', 'mtype=1&pid='|cat:$v.id)#}{#/if#}" >{#$v.name#}
                                    <br>
                                    {#$v.cname#}
                                </a>
                            </p>
                            <p class="product_price">
                                ＄{#$v.price#}
                            </p>
                            <p class="recommnd">
                                總評
                            </p>
                            <div class="product_scroce">
                                <i class="scorce">{#intval($v._overall)#}</i>
                                <span>分</span>
                            </div>
                        </li>
                        {#/foreach#}
                    </ul>
                </div>

            </div>

            {#show_block('b7',0,'','report_f_box')#}

            <div class="more_box">
                <ul class="more_list">
                    <li>
                        <a class="more" href="{#optimize_url('product', 'readReport_list', 'mtype=5')#}">更多體驗報告</a>
                    </li>
                    <li>
                        <a class="more" href="{#optimize_url('product', 'readReport_list', 'mtype=1')#}">更多試用報告</a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="report_box b_box">
            <div class="hd">
                <h2 class="hd_title">提交報告</h2>
            </div>
            <div class="bd">
                <ul class="report_list">
                    {#foreach  from=$submit_report_list item=v key=k#}
                    <li {#if $k neq 0 && $k neq 1#}class="last"{#/if#}>
                        <div class="img_box"><p class="img_p"><a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'report_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'report_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}"><span><img src="{#$v._photo_url#}" alt="{#$v._photo_url#}" ></span></a></p></div>
                        <a class="btn_s btn_s_submit" href="{#if $v.member_type eq 5#}{#optimize_url('product', 'report_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'report_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}"><strong>立即申請</strong></a>
                        <div class="info">
                            <h4 class="product_brand"><a class="product_brand" href="{#if $v.member_type eq 5#}{#optimize_url('product', 'report_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'report_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}">{#$v.type_name#}</a></h4>
                            <p class="product_title">
                                <a href="{#if $v.member_type eq 5#}{#optimize_url('product', 'report_inpage', 'mtype=5&pid='|cat:$v.id)#}{#else#}{#optimize_url('product', 'report_inpage', 'mtype=1&pid='|cat:$v.id)#}{#/if#}">{#$v.name#}<br/>
                                    {#$v.cname#}</a>
                            </p>
                            <table class="report_tb" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="td_l">試用名額</td><td class="td_m">：</td><td class="td_r">{#$v.quota#}</td>
                                </tr>
                                <tr>
                                    <td class="td_l">申請人數</td><td>：</td><td class="td_r">{#$v.apply_num#}</td>
                                </tr>
                                <tr>
                                    <td class="td_l">截止日期</td><td>：</td><td class="td_r">{#date('Y-m-d',strtotime($v.report_endtime))#}</td>
                                </tr>
                                <tr>
                                    <td class="td_l">已提交報告</td><td>：</td><td class="td_r">{#$v._rep_count#}</td>
                                </tr>
                            </table>
                        </div>
                    </li>
                    {#/foreach#}
                </ul>
            </div>
            <div class="more_box">
                <ul class="more_list">
                    <li>
                        <a href="{#optimize_url('product', 'submitReport_list', 'mtype=5')#}" class="more">提交體驗報告</a>
                    </li>
                    <li>
                        <a href="{#optimize_url('product', 'submitReport_list', 'mtype=1')#}" class="more">提交試用報告</a>
                    </li>
                </ul>
            </div>
        </div>

        <div class="report_box_3">
            {#show_block('b14',0,'','report_c_box b_box')#}
            {#show_block('b8',0,'','imore_news_box b_box')#}
        </div>
    </div>
    <!-- main-->
    <div class="sidebar">
        {#show_block('b2',1,'','sidebar_ad')#}
        {#show_block('b17',0,'','sidebar_doing')#}
        <!--  流行新姿 f&b  使用則注釋下面的sidebar_function模塊-->
        <div class="sidebar_fnb b_box"></div>
        <script type="text/javascript">
        $(function(){
                $.getJSON("http://www.fnb.hk/default/api?callback=?",
                function(data){
                        var htmls = '<div class="hd">'
									+'<h2 class="hd_title">Fashion & Beauty 流行新姿</h2>'
									+'</div>'
									+'<div class="bd">'
									+'<div class="mag_box">'
									+'<div class="img_box">'
									+'<p class="img_p">'
									+'<a href="'+data.data.cover.url+'"> <span>'
									+'<img src="'+data.data.cover.image+'" alt="" width="155" height="193"/>'
									+'</span></a>'
									+'</p>'
									+'</div>'
									+'<h4 class="title"><a class="title" href="'+data.data.cover.url+'">'+data.data.cover.subject+'</a></h4>'
									+'<p class="desp"><a class="desp" href="'+data.data.cover.url+'">'+(data.data.cover.message).substring(0,50)+'...</a></p>'
									+'</div>'
									+'<div class="gift_box">'
									+'<div class="img_box">'
									+'<p class="img_p">'
									+'<a href="'+data.data.gift.url+'"> <span>'
									+'<img src="'+data.data.gift.image+'" alt="" width="90" height="90"/>'
									+'</span></a></p>'
									+'</div>'
									+'<i class="fnb_icon"></i>'
									+'<a href="'+data.data.gift.url+'"><h4 class="title">F&B Club 會員有禮</h4></a>'
									+'<p class="desp"><a class="desp" href="'+data.data.gift.url+'">'+data.data.gift.subjectside+' / '+data.data.gift.account+'份</a></p>'
									+'</div>'
									+'</div>';
                
                        $(".sidebar_fnb").html(htmls);
                });
        });
        </script>
        <!--{#show_block('b1',2,'','sidebar_function')#}
        <style> .sidebar_workshop,.index .sidebar_top5{
                margin-bottom:20px;
            }
            
        </style>-->
        {#show_block('b4',0,'','sidebar_workshop')#}

        <!--首頁排行榜5 如需改為3則更換下邊的sidebar_top5 再注釋掉block.php的 action_b5_1模塊-->
        {#show_block('b5',0,'','sidebar_top3 b_box')#}
        <!--{#show_block('b5_1',0,'','sidebar_top5 b_box')#}-->
        {#show_block('b9',0,'','sidebar_tutorial b_box')#}
        {#show_block('b6',0,'','sidebar_facebook')#}
    </div>
    <!-- sidebar -->

</div><!--body-->



{#include file="footer.php"#}